package com.interagriculture.service;

import com.interagriculture.common.PageResult;
import com.interagriculture.entity.Competition;
import com.interagriculture.entity.query.CompetitionQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * (Competition)表服务接口
 *
 * @author makejava
 * @since 2024-10-24 19:14:15
 */
public interface CompetitionService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    Competition queryById(Integer id);


    /**
     * 新增数据
     *
     * @param competition 实例对象
     * @return 实例对象
     */
    Competition insert(Competition competition);

    /**
     * 修改数据
     *
     * @param competition 实例对象
     * @return 实例对象
     */
    Competition update(Competition competition);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);

    /**
     * 查询竞赛信息
     * @param competitionQuery
     * @return
     */
    PageResult findCompetitionInfo(CompetitionQuery competitionQuery);

    /**
     * 添加或修改竞赛信息
     * @param competition
     */
    void saveOrUpdateInfo(Competition competition, MultipartFile picture);
}
